import java.io.File;
import java.io.FileNotFoundException;
import java.io.RandomAccessFile;

public class RandomAccessFileTest {
    static File file = new File("D:\\zuoye\\ceshi\\cece.txt");
    public static void main(String[] args) {
//        if (file.exists()) {
//            file.delete();
//        }
//        new WriteFile(file,1).start();
//        new WriteFile(file,2).start();
        RandomAccessFile raf = null;
        try {
            raf = new RandomAccessFile(file,"r");
            raf.seek(100);
            byte[] b = new byte[1024];
            raf.read(b);
            String str = new String(b);
            System.out.println(str);
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }

    }
}
